package com.bristua.barcode.customer.controller;

import com.bristua.barcode.common.bean.Result;
import com.bristua.barcode.common.util.HandleResultUtil;
import com.bristua.barcode.customer.biz.GetCustomerIdBiz;
import com.bristua.barcode.customer.dao.TCustomerBankMapper;
import com.bristua.barcode.customer.model.condition.TCustomerBankExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

/**
 * Created by Administrator on 2019/8/30.
 */
@RestController
public class QueryCustomerBankController {

    @Autowired
    private GetCustomerIdBiz getCustomerIdBiz;

    @Resource
    private TCustomerBankMapper tCustomerBankMapper;

    
    @PostMapping(value = "/customer/query/bank")
    public Result queryCustomerBank(){
        String customerId = getCustomerIdBiz.getCustomerId();
        TCustomerBankExample tCustomerBankExample = new TCustomerBankExample();
        tCustomerBankExample.createCriteria().andCustomerIdEqualTo(customerId).andStatusEqualTo(1);
        return HandleResultUtil.querySuccessResult(tCustomerBankMapper.selectByExample(tCustomerBankExample));
    }
}
